
const Login = r => require.ensure([], () => r(require('./views/Login.vue')));
const NotFound = r => require.ensure([], () => r(require('./views/404.vue')));
const Home = r => require.ensure([], () => r(require('./views/Home.vue')));


const AdminList = r => require.ensure([], () => r(require('./views/admin/list.vue')));
const Welcome = r => require.ensure([], () => r(require('./views/admin/welcome.vue')));
const AdminRole = r => require.ensure([], () => r(require('./views/admin/role.vue')));
const AdminPosition = r => require.ensure([], () => r(require('./views/admin/position.vue')));
const AdminAuthority = r => require.ensure([], () => r(require('./views/admin/authority.vue')));

const UserList = r => require.ensure([], () => r(require('./views/user/list.vue')));
const UserInfo = r => require.ensure([], () => r(require('./views/user/userinfo.vue')));

const ShopSelfList = r => require.ensure([], () => r(require('./views/shop/selfList.vue')));
const ShopOtherList = r => require.ensure([], () => r(require('./views/shop/otherList.vue')));
const ShopCategory = r => require.ensure([], () => r(require('./views/shop/category.vue')));
//const ShopRebate = r => require.ensure([], () => r(require('./views/shop/rebate.vue')));

const GoodsList = r => require.ensure([], () => r(require('./views/goods/list.vue')));
const GoodsAdd = r => require.ensure([], () => r(require('./views/goods/add.vue')));
//const GoodsEdit = r => require.ensure([], () => r(require('./views/goods/edit.vue')));
const GoodsCategory = r => require.ensure([], () => r(require('./views/goods/category.vue')));
const GoodsBrand = r => require.ensure([], () => r(require('./views/goods/brand.vue')));
const GoodsFeature = r => require.ensure([], () => r(require('./views/goods/feature.vue')));
//const GoodsProperty = r => require.ensure([], () => r(require('./views/goods/property.vue')));

const OrderList = r => require.ensure([], () => r(require('./views/order/list.vue')));

const FinanceList = r => require.ensure([], () => r(require('./views/finance/list.vue')));
const FinanceInfund = r => require.ensure([], () => r(require('./views/finance/infund.vue')));
const FinancePoints = r => require.ensure([], () => r(require('./views/finance/points.vue')));
const FinanceCheck = r => require.ensure([], () => r(require('./views/finance/check.vue')));
const FinanceRebate = r => require.ensure([], () => r(require('./views/finance/rebate.vue')));
const FinanceOperation = r => require.ensure([], () => r(require('./views/finance/addAndSubtract.vue')));

const NewsList = r => require.ensure([], () => r(require('./views/news/list.vue')));

const ActivityList = r => require.ensure([], () => r(require('./views/activity/list.vue')));
const ActivityClassify = r => require.ensure([], () => r(require('./views/activity/classify.vue')));


const BannerList = r => require.ensure([], () => r(require('./views/banner/list.vue')));
const LogList = r => require.ensure([], () => r(require('./views/message/list.vue')));
const MessageSystem = r => require.ensure([], () => r(require('./views/log/list.vue')));
const StartupList = r => require.ensure([], () => r(require('./views/startup/list.vue')));
const transactionList = r => require.ensure([], () => r(require('./views/transaction/list.vue')));



let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: true
    },
    {
        path: '/',
        component: Home,
        name: '管理员管理',
        iconCls: 'fa fa-envelope',
        children: [
            { path: '/admin/list', component: AdminList, name: '后台用户列表' },
            { path: '/admin/welcome', component: Welcome, name: '欢迎页', hidden:true },
			{ path: '/admin/role', component: AdminRole, name: '角色类型管理' },
			{ path: '/admin/position', component: AdminPosition, name: '角色职位管理' },
			{ path: '/admin/authority', component: AdminAuthority, name: '权限分配', hidden:true }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '用户管理',
        iconCls: 'fa fa-address-card',
        children: [
			{ path: '/user/list', component: UserList, name: '用户列表' },
			{ path: '/user/userinfo', component: UserInfo, name: '用户详情', hidden: true }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '商家管理',
        iconCls: 'fa fa-address-card',
        //leaf: true,//只有一个节点
        children: [
			{ path: '/shop/selfList', component: ShopSelfList, name: '自营店铺' },
			{ path: '/shop/otherList', component: ShopOtherList, name: '入驻商家' },
			{ path: '/shop/category', component: ShopCategory, name: '商家分类' },
            //{ path: '/shop/rebate', component: ShopRebate, name: '返利佣金' }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '商品管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/goods/list', component: GoodsList, name: '商品列表' },
			{ path: '/goods/add', component: GoodsAdd, name: '商品添加' ,hidden: true},
			{ path: '/goods/edit', component: GoodsAdd, name: '商品编辑' ,hidden: true},
			{ path: '/goods/category', component: GoodsCategory, name: '商品分类' },
			{ path: '/goods/brand', component: GoodsBrand, name: '商品品牌' },
			{ path: '/goods/feature', component: GoodsFeature, name: '商品规格' },
			// { path: '/goods/property', component: GoodsProperty, name: '商品属性' }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '订单管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/order/list', component: OrderList, name: '订单列表' },
        ]
    },
    {
        path: '/',
        component: Home,
        name: '财务管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/finance/list', component: FinanceList, name: '流水明细' },
			{ path: '/finance/infund', component: FinanceInfund, name: '充值管理' },
			{ path: '/finance/points', component: FinancePoints, name: '积分管理' },
			{ path: '/finance/check', component: FinanceCheck, name: '提现管理' },
			{ path: '/finance/rebate', component: FinanceRebate, name: '返利管理' },
	        { path: '/finance/operation', component: FinanceOperation, name: '加减金额' },
        ]
    },
    {
        path: '/',
        component: Home,
        name: '新闻管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/news/list', component: NewsList, name: '新闻列表' }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '活动管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/activity/list', component: ActivityList, name: '活动列表' },
			{ path: '/activity/classify', component: ActivityClassify, name: '活动分类'}
        ]
    },
    {
        path: '/',
        component: Home,
        name: '消息管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/message/system', component: MessageSystem, name: '消息列表' }
        ]
    },
    {
        path: '/',
        component: Home,
	    name: 'Banner管理',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/banner/list', component: BannerList, name: 'Banner列表' }
        ]
    },
    {
        path: '/',
        component: Home,
	    name: '启动页设置',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/startup/list', component: StartupList, name: '启动页管理' }
        ]
    },
    {
        path: '/',
        component: Home,
	    name: '操作日志',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/log/list', component: LogList, name: '日志列表' }
        ]
    },
    {
        path: '/',
        component: Home,
	    name: '邀请有礼',
        iconCls: 'fa fa-bar-chart',
        children: [
			{ path: '/transaction/list', component: transactionList, name: '邀请有礼管理' }
        ]
    },
    {
        path: '*',
        hidden: true,
        redirect: { path: '/404' }
    }
];

export default routes;

